package com.iwhalecloud.citybrain.flow.platform.manager.domain.model.model;

import java.io.Serializable;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.node.ObjectNode;

/**
 * @author lilh
 * @date 2019-06-17 10:22
 */
public class ModelVariableVo implements Serializable {
    private static final long serialVersionUID = 7117309128985755634L;

    /** 变量名 */
    private String name;

    /** 变量编码 */
    private String code;

    /** 变量类型 */
    private String type;

    /** 默认值 */
    private String defaultValue;

    /** 说明描述 */
    private String description;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getDefaultValue() {
        return defaultValue;
    }

    public void setDefaultValue(String defaultValue) {
        this.defaultValue = defaultValue;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public JsonNode toJsonNode() {
        ObjectNode objectNode = new ObjectMapper().createObjectNode();
        objectNode.put("name", this.name);
        objectNode.put("code", this.code);
        objectNode.put("type", this.type);
        objectNode.put("defaultValue", this.defaultValue);
        objectNode.put("description", this.description);
        return objectNode;
    }
}
